]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
man: Port the man pages to reStructuredText
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 28 Aug 2024 10:52:05 +0000 (12:52 +0200)
committerMarge Bot <marge-bot@gnome.org>
Wed, 28 Aug 2024 19:49:45 +0000 (19:49 +0000)
It's as human-readable as asciidoc and produces the same results,
but the tooling is more widely supported. Also both GLib and GTK
switched to it for their man pages, so rst2man is already a
dependency of the platform.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3454>

man/gnome-shell.txt
man/meson.build
man/stylesheet.xsl [deleted file]
meson.build
subprojects/extensions-tool/man/gnome-extensions.txt
subprojects/extensions-tool/man/meson.build
subprojects/extensions-tool/man/stylesheet.xsl [deleted file]
subprojects/extensions-tool/meson.build

index 919d42483debf3824e89ba41fdc181a1a5370e92..d90ea5f6c1b9740428254ad0697e1201dd590453 100644 (file)
@@ -1,17 +1,17 @@
-GNOME-SHELL(1)
-=============
-:man manual: User Commands
-:man source: GNOME-SHELL
-:doctype: manpage
-:date: December 2020
-
-NAME
-----
-gnome-shell - Graphical shell for the GNOME desktop
+===========
+gnome-shell
+===========
+
+-------------------------------------
+Graphical shell for the GNOME desktop
+-------------------------------------
+
+:Manual section: 1
+:Manual group: User Commands
 
 SYNOPSIS
 --------
-*gnome-shell* ['OPTION'...]
+**gnome-shell** [*OPTION*...]
 
 DESCRIPTION
 -----------
@@ -27,53 +27,69 @@ It is started in the window manager phase of the session.
 
 OPTIONS
 -------
-*--wayland*::
-Run as a wayland compositor
+``--wayland``
+
+  Run as a wayland compositor
+
+``--display-server``
+
+  Run as a full display server, rather than nested
+
+``--nested``
+
+  Run as a nested compositor
+
+``--no-x11``
+
+  Run wayland compositor without starting Xwayland
+
+``--x11``
+
+  Run with X11 backend
+
+``--wayland-display``\ =\ *DISPLAY*
+
+  Wayland display name to use
+
+``-d``, ``--display``\ =\ *DISPLAY*
+
+  X display to use
+
+``-r``, ``--replace``
+
+  Replace the running window manager
+
+``--sm-disable``
 
-*--display-server*::
-Run as a full display server, rather than nested
+  Disable connection to the session manager
 
-*--nested*::
-Run as a nested compositor
+``--sm-client-id``\ =\ *ID*
 
-*--no-x11*::
-Run wayland compositor without starting Xwayland
+  Specify session management *ID*
 
-*--x11*::
-Run with X11 backend
+``--sm-save-file``\ =\ *FILE*
 
-*--wayland-display*='DISPLAY'::
-Wayland display name to use
+  Initialize session from *FILE*
 
-*-d*, *--display*='DISPLAY'::
-X display to use
+``--sync``
 
-*-r*, *--replace*::
-Replace the running window manager
+  Make X calls synchronous
 
-*--sm-disable*::
-Disable connection to the session manager
+``--mode=MODE``
 
-*--sm-client-id*='ID'::
-Specify session management 'ID'
+  Use a specific mode, e.g. "gdm" for login screen
 
-*--sm-save-file*='FILE'::
-Initialize session from 'FILE'
+``--list-modes``
 
-*--sync*::
-Make X calls synchronous
+  List possible modes and exit
 
-*--mode*='MODE'::
-Use a specific mode, e.g. "gdm" for login screen
+``--version``
 
-*--list-modes*::
-List possible modes and exit
+  Print version and exit
 
-*--version*::
-Print version and exit
+``--help``
 
-*--help*::
-Display help and exit
+  Display help and exit
 
 FILES
 -----
index aa37ef0f3a2ec3bdc433607ceaed9f533c6414e0..8aa332c104a0dd296f6f69dd314939528b01ad50 100644 (file)
@@ -1,7 +1,8 @@
 custom_target('man page',
-  input: ['gnome-shell.txt', 'stylesheet.xsl'],
+  input: 'gnome-shell.txt',
   output: 'gnome-shell.1',
-  command: [a2x, '-D', '@OUTDIR@', '--xsl-file', '@INPUT1@', '-f' ,'manpage', '@INPUT0@'],
+  command: [rst2man, '--syntax-highlight=none', '@INPUT@'],
+  capture: true,
   install_dir: mandir + '/man1',
   install: true
 )
diff --git a/man/stylesheet.xsl b/man/stylesheet.xsl
deleted file mode 100644 (file)
index 047bd1b..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version='1.0'?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-               version='1.0'>
-<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"/>
-
-<xsl:template match="variablelist/title">
-  <xsl:text>.PP&#10;</xsl:text>
-  <xsl:call-template name="bold">
-    <xsl:with-param name="node" select="."/>
-    <xsl:with-param name="context" select=".."/>
-  </xsl:call-template>
-  <xsl:text>&#10;</xsl:text>
-</xsl:template>
-
-<xsl:template match="varlistentry[preceding-sibling::title]">
-  <xsl:if test="not(preceding-sibling::varlistentry)">
-    <xsl:text>.RS 4&#10;</xsl:text>
-    <!-- comment out the leading .PP added by the original template -->
-    <xsl:text>.\"</xsl:text>
-  </xsl:if>
-  <xsl:apply-imports/>
-  <xsl:if test="position() = last()">
-    <xsl:text>.RE&#10;</xsl:text>
-  </xsl:if>
-</xsl:template>
-
-</xsl:stylesheet>
index e5c40fdf49c73a7c512e3883cb7b78878db5ba87..1fec5f6bd3da93f9fba4eb0d9bda040c2d466775 100644 (file)
@@ -132,7 +132,7 @@ else
 endif
 
 if get_option('man')
-  a2x = find_program('a2x')
+  rst2man = find_program('rst2man')
   subdir('man')
 endif
 
index 20d5fd4155d95f59a27531c0a5199ed1522b2937..1014abd53f7a735d01ed8f629a3fcdce862e59bc 100644 (file)
-GNOME-EXTENSIONS(1)
-===================
-:man manual: User Commands
-:man source: GNOME-EXTENSIONS-TOOL
-:doctype: manpage
-:date: August 2018
-
-NAME
-----
-gnome-extensions - Command line tool for managing GNOME extensions
+================
+gnome-extensions
+================
+
+-----------------------------------------------
+Command line tool for managing GNOME extensions
+-----------------------------------------------
+
+:Manual section: 1
+:Manual group: User Commands
 
 SYNOPSIS
 --------
-*gnome-extensions* help ['COMMAND']
 
-*gnome-extensions* version
+|  **gnome-extensions** help [*COMMAND*]
+|  **gnome-extensions** version
+|  **gnome-extensions** enable *UUID*
+|  **gnome-extensions** disable *UUID*
+|  **gnome-extensions** reset *UUID*
+|  **gnome-extensions** info *UUID*
+|  **gnome-extensions** show *UUID*
+|  **gnome-extensions** list [*OPTION*...]
+|  **gnome-extensions** prefs *UUID*
+|  **gnome-extensions** create [*OPTION*...]
+|  **gnome-extensions** pack [*OPTION*...]
+|  **gnome-extensions** install [*OPTION*...] *PACK*
+|  **gnome-extensions** uninstall *UUID*
 
-*gnome-extensions* enable 'UUID'
+DESCRIPTION
+-----------
+``gnome-extensions`` is a utility that makes some common GNOME extensions
+operations available on the command line.
 
-*gnome-extensions* disable 'UUID'
+COMMON OPTIONS
+--------------
+All commands except for ``help`` and ``version`` handle the following options:
 
-*gnome-extensions* reset 'UUID'
+``--quiet``, ``-q``
 
-*gnome-extensions* info 'UUID'
+  Do not print error messages
 
-*gnome-extensions* show 'UUID'
+COMMANDS
+--------
+``help`` [*COMMAND*]
 
-*gnome-extensions* list ['OPTION'...]
+  Displays a short synopsis of the available commands or provides
+  detailed help on a specific command.
 
-*gnome-extensions* prefs 'UUID'
+``version``
 
-*gnome-extensions* create ['OPTION'...]
+  Prints the program version.
 
-*gnome-extensions* pack ['OPTION'...]
+``enable`` *UUID*
 
-*gnome-extensions* install ['OPTION'...] 'PACK'
+  Enables the extension identified by *UUID*.
 
-*gnome-extensions* uninstall 'UUID'
+  The command will not detect any errors from the extension itself, use the
+  ``info`` command to confirm that the extension state is *ACTIVE*.
 
-DESCRIPTION
------------
-*gnome-extensions* is a utility that makes some common GNOME extensions
-operations available on the command line.
+  If the extension is already enabled, the command will do nothing.
 
-COMMON OPTIONS
---------------
-All commands except for *help* and *version* handle the following options:
+``disable`` *UUID*
 
-*--quiet*, *-q*::
-Do not print error messages
+  Disables the extension identified by *UUID*.
 
-COMMANDS
---------
-*help* ['COMMAND']::
-Displays a short synopsis of the available commands or provides
-detailed help on a specific command.
+  If the extension is not enabled, the command will do nothing.
+
+``reset`` *UUID*
+
+  Reset the extension identified by *UUID*.
+
+  The extension will be disabled in GNOME, but may be enabled by other sessions
+  like GNOME Classic.
+
+``info`` *UUID*
+
+  Show details of the extension identified by *UUID*, including name,
+  description and state.
+
+``show`` *UUID*
+
+  Synonym of info.
+
+``list`` [*OPTION*...]
+
+  Displays a list of installed extensions.
+
+  **Options**
+
+    ``--user``
+
+      Include extensions installed in the user's ``$HOME``
+
+    ``--system``
+
+      Include extensions installed in the system
+
+    ``--enabled``
+
+      Include enabled extensions
+
+    ``--disabled``
+
+      Include disabled extensions
+
+    ``--active``
+
+      Only include extensions in active state
+
+    ``--inactive``
+
+      Only include extensions in inactive state
+
+    ``--prefs``
+
+      Only include extensions with preferences
+
+    ``--updates``
+
+      Only include extensions with pending updates
+
+    ``-d``, ``--details``
+
+      Show some extra information for each extension
+
+``prefs`` *UUID*
+
+  Open the preference dialog of the extension identified by *UUID*.
+
+
+``create`` [*OPTION*...]
+
+  Creates a new extension from a template.
+
+  **Options**
+
+    ``--name``\ =\ *NAME*
+
+      Set the user-visible name in the extension's metadata
+      to *NAME*
+
+    ``--description``\ =\ *DESC*
+
+      Set the description in the extension's metadata to *DESC*
+
+    ``--uuid``\ =\ *UUID*
+
+      Set the unique extension ID in the metadata to *UUID*
+
+    ``--gettext-domain``\ =\ *DOMAIN*
+
+      Set the gettext domain used by the extension
+
+    ``--settings-schema``\ =\ *SCHEMA*
+
+      Set the GSettings schema used by the extension
+
+    ``--template``\ =\ *TEMPLATE*
+
+      Use *TEMPLATE* as base for the new extension
+
+    ``--prefs``
+
+      Include a prefs.js template
+
+    ``-i``,
+    ``--interactive``
+
+      Prompt for any extension metadata that hasn't been provided
+      on the command line
+
+``pack`` [*OPTION*...] [*SOURCE-DIRECTORY*]
+
+  Creates an extension bundle that is suitable for publishing.
+
+  The bundle will always include the required files extension.js
+  and metadata.json, as well as any of the optional stylesheet.css,
+  stylesheet-dark.css, stylesheet-light.css or prefs.js if found.
+  Each additional source that should be included must be specified
+  with ``--extra-source``.
+
+  If the extension includes one or more GSettings schemas, they can
+  either be placed in a schemas/ folder to be picked up automatically,
+  or be specified with ``--schema``.
+
+  Similarily, translations are included automatically when they are
+  located in a po/ folder, otherwise the ``--podir`` option can be
+  used to point to the correct directory. If no gettext domain is
+  provided on the command line, the value of the ``gettext-domain``
+  metadata field is used if it exists, and the extension UUID
+  if not.
+
+  All files are searched in *SOURCE-DIRECTORY* if specified, or
+  the current directory otherwise.
+
+  **Options**
+
+    ``--extra-source``\ =\ *FILE*
+
+      Additional source to include in the bundle
+
+    ``--schema``\ =\ *SCHEMA*
+
+      A GSettings schema that should be compiled and
+      included
+
+    ``--podir``\ =\ *PODIR*
+
+      A directory with translations that should be
+      compiled and included
+
+    ``--gettext-domain``\ =\ *DOMAIN*
+
+      The gettext domain to use for translations
+
+    ``-f``, ``--force``
+
+      Overwrite an existing pack
+
+    ``-o``, ``--out-dir``\ =\ *DIRECTORY*
+
+      The directory where the pack should be created
+
+``install`` [*OPTION*...] *PACK*
+
+  Installs an extension from the bundle *PACK*.
+
+  The command unpacks the extension files and moves them to
+  the expected location in the user's ``$HOME``, so that it
+  will be loaded in the next session.
+
+  It is mainly intended for testing, not as a replacement for
+  the extension website. As extensions have privileged access
+  to the user's session, it is advised to never load extensions
+  from untrusted sources without carefully reviewing their content.
+
+  **Options**
+
+    ``--force``
+
+      Override an existing extension
 
-*version*::
-Prints the program version.
+``uninstall`` *UUID*
 
-*enable* 'UUID'::
-Enables the extension identified by 'UUID'.
-+
-The command will not detect any errors from the extension itself, use the
-*info* command to confirm that the extension state is *ACTIVE*.
-+
-If the extension is already enabled, the command will do nothing.
-
-*disable* 'UUID'::
-Disables the extension identified by 'UUID'.
-+
-If the extension is not enabled, the command will do nothing.
-
-*reset* 'UUID'::
-Reset the extension identified by 'UUID'.
-+
-The extension will be disabled in GNOME, but may be enabled by other sessions
-like GNOME Classic.
-
-*info* 'UUID'::
-Show details of the extension identified by 'UUID', including name,
-description and state.
-
-*show* 'UUID'::
-Synonym of info.
-
-*list* ['OPTION'...]::
-Displays a list of installed extensions.
-+
-.Options
-  *--user*;;
-    Include extensions installed in the user's *$HOME*
-
-  *--system*;;
-    Include extensions installed in the system
-
-  *--enabled*;;
-    Include enabled extensions
-
-  *--disabled*;;
-    Include disabled extensions
-
-  *--active*;;
-    Only include extensions in active state
-
-  *--inactive*;;
-    Only include extensions in inactive state
-
-  *--prefs*;;
-    Only include extensions with preferences
-
-  *--updates*;;
-    Only include extensions with pending updates
-
-  *-d*;;
-  *--details*;;
-    Show some extra information for each extension
-
-*prefs* 'UUID'::
-Open the preference dialog of the extension identified by 'UUID'.
-
-
-*create* ['OPTION'...]::
-Creates a new extension from a template.
-+
-.Options
-  *--name*='NAME':::
-    Set the user-visible name in the extension's metadata
-    to 'NAME'
-
-  *--description*='DESC':::
-    Set the description in the extension's metadata to 'DESC'
-
-  *--uuid*='UUID':::
-    Set the unique extension ID in the metadata to 'UUID'
-
-  *--gettext-domain*='DOMAIN':::
-    Set the gettext domain used by the extension
-
-  *--settings-schema*='SCHEMA':::
-    Set the GSettings schema used by the extension
-
-  *--template*='TEMPLATE':::
-    Use 'TEMPLATE' as base for the new extension
-
-  *--prefs*:::
-    Include a prefs.js template
-
-  *-i*:::
-  *--interactive*:::
-    Prompt for any extension metadata that hasn't been provided
-    on the command line
-
-*pack* ['OPTION'...] ['SOURCE-DIRECTORY']::
-Creates an extension bundle that is suitable for publishing.
-+
-The bundle will always include the required files extension.js
-and metadata.json, as well as any of the optional stylesheet.css,
-stylesheet-dark.css, stylesheet-light.css or prefs.js if found.
-Each additional source that should be included must be specified
-with *--extra-source*.
-+
-If the extension includes one or more GSettings schemas, they can
-either be placed in a schemas/ folder to be picked up automatically,
-or be specified with *--schema*.
-+
-Similarily, translations are included automatically when they are
-located in a po/ folder, otherwise the *--podir* option can be
-used to point to the correct directory. If no gettext domain is
-provided on the command line, the value of the *gettext-domain*
-metadata field is used if it exists, and the extension UUID
-if not.
-+
-All files are searched in 'SOURCE-DIRECTORY' if specified, or
-the current directory otherwise.
-+
-.Options
-  *--extra-source*='FILE':::
-    Additional source to include in the bundle
-
-  *--schema*='SCHEMA':::
-    A GSettings schema that should be compiled and
-    included
-
-  *--podir*='PODIR':::
-    A directory with translations that should be
-    compiled and included
-
-  *--gettext-domain*='DOMAIN':::
-    The gettext domain to use for translations
-
-  *-f*:::
-  *--force*:::
-    Overwrite an existing pack
-
-  *-o*:::
-  *--out-dir*='DIRECTORY':::
-    The directory where the pack should be created
-
-*install* ['OPTION'...] 'PACK'::
-Installs an extension from the bundle 'PACK'.
-+
-The command unpacks the extension files and moves them to
-the expected location in the user's *$HOME*, so that it
-will be loaded in the next session.
-+
-It is mainly intended for testing, not as a replacement for
-the extension website. As extensions have privileged access
-to the user's session, it is advised to never load extensions
-from untrusted sources without carefully reviewing their content.
-+
-.Options
-  *--force*:::
-    Override an existing extension
-
-*uninstall* 'UUID'::
-Uninstalls the extension identified by 'UUID'.
+  Uninstalls the extension identified by *UUID*.
 
 
 EXIT STATUS
index 643509c16fbd746d53ce36681b6a4703c2200d25..697211736a427911a6ff482e4bf2bc346753c3ec 100644 (file)
@@ -1,7 +1,8 @@
 custom_target('gnome-extensions.1',
-  input: ['gnome-extensions.txt', 'stylesheet.xsl'],
+  input: 'gnome-extensions.txt',
   output: 'gnome-extensions.1',
-  command: [a2x, '-D', '@OUTDIR@', '--xsl-file', '@INPUT1@', '-f', 'manpage', '@INPUT0@'],
+  command: [rst2man, '--syntax-highlight=none', '@INPUT@'],
+  capture: true,
   install_dir: mandir + '/man1',
   install: true
 )
diff --git a/subprojects/extensions-tool/man/stylesheet.xsl b/subprojects/extensions-tool/man/stylesheet.xsl
deleted file mode 100644 (file)
index 047bd1b..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version='1.0'?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-               version='1.0'>
-<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"/>
-
-<xsl:template match="variablelist/title">
-  <xsl:text>.PP&#10;</xsl:text>
-  <xsl:call-template name="bold">
-    <xsl:with-param name="node" select="."/>
-    <xsl:with-param name="context" select=".."/>
-  </xsl:call-template>
-  <xsl:text>&#10;</xsl:text>
-</xsl:template>
-
-<xsl:template match="varlistentry[preceding-sibling::title]">
-  <xsl:if test="not(preceding-sibling::varlistentry)">
-    <xsl:text>.RS 4&#10;</xsl:text>
-    <!-- comment out the leading .PP added by the original template -->
-    <xsl:text>.\"</xsl:text>
-  </xsl:if>
-  <xsl:apply-imports/>
-  <xsl:if test="position() = last()">
-    <xsl:text>.RE&#10;</xsl:text>
-  </xsl:if>
-</xsl:template>
-
-</xsl:stylesheet>
index 7ae2cf14b81ef89d196d7dde226b35f7ae76c453..5735b9387ebf51a940a8700fbec4e7edb5c383a0 100644 (file)
@@ -47,7 +47,7 @@ if bash_completion.found()
 endif
 
 if get_option('man')
-  a2x = find_program('a2x')
+  rst2man = find_program('rst2man')
   subdir('man')
 endif